VERSION 5.00
Begin VB.Form NewClientCodeForm 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   12000
   LinkTopic       =   "Form1"
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VCT.EnterClientCode EnterClientCode1 
      Height          =   4095
      Left            =   720
      TabIndex        =   5
      Top             =   4560
      Width           =   7335
      _ExtentX        =   12938
      _ExtentY        =   7223
   End
   Begin VCT.NewClientCode NewClientCode1 
      Height          =   3135
      Left            =   720
      TabIndex        =   4
      Top             =   4560
      Width           =   6855
      _ExtentX        =   12091
      _ExtentY        =   5530
   End
   Begin VCT.ClientReception Client 
      Height          =   3135
      Left            =   360
      TabIndex        =   3
      Top             =   360
      Width           =   5415
      _ExtentX        =   9551
      _ExtentY        =   5530
   End
   Begin VB.CommandButton Clear_Button 
      Caption         =   "Clear"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   2
      Top             =   5160
      Visible         =   0   'False
      Width           =   1935
   End
   Begin VB.CommandButton Next_Button 
      Caption         =   "Next"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   1
      Top             =   6360
      Width           =   1935
   End
   Begin VB.CommandButton Cancel_Button 
      BackColor       =   &H008080FF&
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   7560
      Width           =   1935
   End
End
Attribute VB_Name = "NewClientCodeForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim ClientCodeString As String

Private Sub Cancel_Button_Click()
   RegMenuForm.Show
   Unload Me
End Sub

Private Sub EnterClientCode1_KeyPressedEvent()
   Next_Button.Enabled = True
   ClientCodeString = ClientCodeString & EnterClientCode1.KeyPressed
   Client.ClientCode = ClientCodeString
End Sub

Private Sub Form_Load()
   Next_Button.Enabled = False
   Client.ClientCodeEnabled = False
   Client.ClientSex = Sex
   Client.ReturnVisit = RETURNV
   Client.EnableNCCStar
   EnterClientCode1.Visible = False
   ClientCodeString = ""
End Sub

Private Sub ReturnVisitNo_Button_Click()
   Next_Button.Enabled = True
End Sub

'Private Sub ReturnVisit1_SelectionMade()
'   ReturnVisit1.Visible
'   RETURNV = ReturnVisit1.ClientReturnVisit
'   Client.ReturnVisit = RETURNV
'   Next_Button.Enabled = True
'End Sub

Private Sub NewClientCode1_SelectionMade()
   'The NewClientCode control returns 0 for no new client code, 1 means assign a new client code
   NEWCODE = NewClientCode1.ClientNewClientCode
   Client.NewClientCode = NEWCODE
   If NewClientCode1.ClientNewClientCode = "0" Then 'use old code so show keypad
      EnterClientCode1.Visible = True
      NewClientCode1.Visible = False
      Client.ClientCodeEnabled = True
      Client.EnableCCStar
   Else
      If NewClientCode1.ClientNewClientCode = "1" Then ' assign a new client code
         ClientCodeString = GetNextClientCode
        ' NewNextClientCode = NewNextClientCode + 1
         Next_Button.Enabled = True
      Else
         'ERROR
      End If
   End If
End Sub

Private Sub Next_Button_Click()
   If Val(ClientCodeString) <= Val(NextClientCode) Then
      CLIENTCO = ClientCodeString
      AddPartnerForm.Show
      Unload Me
   Else
      Global_Error_Msg = "The client code you have entetered is " & ClientCodeString & ". This is greater than the highest previously issued client code (which was " & NextClientCode & "). You must have eneterd it incorrectly.  Please check and re-enter the client code."
      Global_Error_Form.Show 1
      Next_Button.Enabled = False
      ClientCodeString = ""
      Client.ClientCode = ClientCodeString
   End If
End Sub
